home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / remote / mult200.zip / BBS.BAT next >
DOS Batch File  |  1991-12-10  |  13KB  |  508 lines

  1. @echo off
  2. if .%1 == .reload goto loadra
  3. cls
  4. if not exist c:\ra\%node%load.txt goto ok2load
  5. echo.
  6. echo 
  7. echo The system shows that Node %node% is already loaded!
  8. echo.
  9. echo If you KNOW that Node %node% is not loaded and is being
  10. echo brought back up after a crash (closing down the DV window
  11. echo without exiting FD correctly ie: ALT C Y), then you need
  12. echo to go to your RA directory delete the %node%LOAD.TXT file
  13. echo and create the %node%ISDOWN.TXT file. Then you can reload
  14. echo this Node.
  15. echo.
  16. echo Press [ENTER] to close this Task down.
  17. pause
  18. goto endok3
  19. :ok2load
  20. if %node% == N1 set port=1
  21. if %node% == N2 set port=2
  22. if %node% == N3 set port=0
  23. echo.
  24. echo Selected Port is %port%.
  25. echo.
  26. set fd=c:\fd\%node%
  27. set fdovr=c:\fd
  28. set fmovr=c:\fd
  29. set fdopt=INTL
  30. set ra=c:\ra
  31. set raovr=c:\ra
  32. set imail=c:\ra
  33. set mbu=c:\ra\mbutil.ctl
  34. echo.
  35. echo Checking for DESQview.
  36. dvactive
  37. if errorlevel 1 goto dvstuff
  38. echo.
  39. echo DESQview NOT detected.
  40. echo Loading ANSI driver and FOSSIL driver..
  41. c:\dv\dvansi
  42. bnu /f+ /m- /q
  43. bnu /c
  44. goto start
  45. :dvstuff
  46. echo.
  47. echo DESQview Detected!
  48. echo Loading ANSI driver and Recapturing the FOSSIL interrupt...
  49. echo.
  50. c:\dv\dvansi
  51. bnu /c
  52. :start
  53. echo.
  54. echo Removing old %node% lockout files.
  55. if exist c:\ra\%node%*.txt del c:\ra\%node%*.txt
  56. if exist c:\ra\%node%\dobbs.bat del c:\ra\%node%\dobbs.bat
  57. rem>c:\ra\%node%load.txt
  58. echo.
  59. echo Node %node% is going back online!
  60. c:
  61. cd\ra\%node%
  62. if %node% == N3 goto ralocal
  63. c:\fd\fd.exe
  64. if errorlevel 255 goto diffexit
  65. if errorlevel 240 set baud=2400
  66. if errorlevel 240 goto racall
  67. if errorlevel 120 set baud=1200
  68. if errorlevel 120 goto racall
  69. if errorlevel 110 set baud=300
  70. if errorlevel 110 goto racall
  71. if errorlevel 101 goto outbound
  72. if errorlevel 100 goto inbound
  73. if errorlevel  40 goto ralocal
  74. if errorlevel  33 goto nightly
  75. if errorlevel  31 goto weekly
  76. if errorlevel  10 goto endok
  77. if errorlevel   1 goto enderror
  78. :diffexit
  79. dtr com%port%: on
  80. at com%port%: h1
  81. echo.
  82. echo Notifying other nodes that I'm DOWN....
  83. rem>c:\ra\%node%down.txt
  84. goto endok2
  85. :racall
  86. cls
  87. echo.
  88. echo We have a caller!
  89. if exist c:\ra\N?toss.txt goto fdbusy
  90. rem>c:\ra\%node%isup.txt
  91. if not exist c:\ra\%node%\dobbs.bat goto loadra
  92. dobbs.bat
  93. :loadra
  94. ra -%node% -C%port% -B%baud% -E20 %event%
  95. :afterra
  96. echo.
  97. echo Checking Remote Access Exit Errorlevels....
  98. if errorlevel 20 goto update
  99. if errorlevel 11 goto ldv
  100. if errorlevel  5 goto outbound
  101. if errorlevel  4 goto outbound
  102. if errorlevel  3 goto outbound
  103. if errorlevel  2 goto ralocal
  104. if errorlevel  1 goto enderror
  105. if errorlevel  0 goto endok
  106. :ldv
  107. echo.
  108. echo Running Long Distance Verifier.
  109. ldv
  110. echo.
  111. echo Notifying User of making sure to leave SysOp Feedback
  112. echo so I can make sure I mail him his special LDV password.
  113. echo.>com%port%:
  114. echo.>com%port%:
  115. echo Please leave me a message stating that you had to use LDV>com%port%:
  116. echo so you could have access to this system. If you don't tell>com%port%:
  117. echo me, it will take longer for you to get your letter.>com%port%:
  118. echo.>com%port%:
  119. echo This option isn't used very much and i don't check it>com%port%:
  120. echo very often.>com%port%:
  121. echo.>com%port%:
  122. echo Thank you,>com%port%:
  123. echo Sysop>com%port%:
  124. dvcomand wait 50
  125. goto restart
  126. :restart 
  127. echo.
  128. echo Reloading RA after a type 15 exit...
  129. c:
  130. cd\ra\%node%
  131. ra -R -G -E20 -%node% -C%port% -B%baud%
  132. goto afterra
  133. :inbound
  134. cls
  135. echo.
  136. echo We have inbound mail!
  137. echo.
  138. if exist c:\ra\N?toss.txt goto innodechk
  139. if exist c:\ra\n3inchck.txt goto 3upin
  140. if exist c:\ra\n2inchck.txt goto 2upin
  141. if exist c:\ra\n1inchck.txt goto 1upin
  142. if exist c:\ra\N3outchk.txt goto 3upin
  143. if exist c:\ra\N1outchk.txt goto 2upin
  144. if exist c:\ra\N2outchk.txt goto 1upin
  145. if %node% == N1 goto downthisnode
  146. if %node% == N2 goto downthisnode
  147. if %node% == N3 goto 3upin
  148. :innodechk
  149. echo.
  150. echo Another node is already Tossing INBOUND mail.
  151. echo Waiting till later...
  152. if %node% == N1 goto start
  153. if %node% == N2 goto start
  154. if %node% == N3 del c:\ra\%node%*.txt
  155. If %node% == N3 goto end
  156. :downthisnode
  157. dtr com%port%: off
  158. dtr com%port%: on
  159. at com%port%: h1
  160. if %node% == N1 goto 2upin
  161. if %node% == N2 goto 1upin
  162. :3upin
  163. if exist c:\ra\N1isup.txt goto 3upin1
  164. if exist c:\ra\N2isup.txt goto 3upin1
  165. goto tossit
  166. :3upin1
  167. rem > c:\ra\mail!.txt
  168. if exist c:\ra\%node%*.txt del c:\ra\%node%*.txt
  169. goto end
  170. :2upin
  171. if exist c:\ra\N2isup.txt goto 2upin1
  172. if exist c:\ra\N3isup.txt goto 2upin1
  173. goto tossit
  174. :2upin1
  175. rem > c:\ra\mail!.txt
  176. goto start
  177. :1upin
  178. if exist c:\ra\N1isup.txt goto 1upin1
  179. if exist c:\ra\N3isup.txt goto 1upin1
  180. goto tossit
  181. :1upin1
  182. rem > c:\ra\mail!.txt
  183. goto start
  184. :tossit
  185. echo.
  186. echo Locking out other nodes for the Tossing of INBOUND mail...
  187. rem>c:\ra\%node%toss.txt
  188. echo.
  189. echo Making sure phone is OFF the hook...
  190. dtr com%port%: off
  191. dtr com%port%: on
  192. at com%port%: h1
  193. echo.
  194. echo Looking to see what we got. Don'cha love christmas -=B-)
  195. c:
  196. cd\fd\files\news
  197. if not exist ..\fnews???.* goto nodelist
  198. echo.
  199. echo Found new FIDO Snooze. Unpacking it...
  200. spaz -d ..\fnews*
  201. :nodelist
  202. cd\fd\nodelist
  203. if exist c:\fd\files\nodediff.* goto fidodiff
  204. goto unpackmail
  205. :fidodiff
  206. echo.
  207. echo Found a new FIDOnet NodeDiff....
  208. :nodechker
  209. if %node% == N1 goto diffn1
  210. if %node% == N2 goto diffn2
  211. if %node% == N3 goto diffn3
  212. :diffn1
  213. rem>c:\fd\n2\fdexit.255
  214. :1diffn1
  215. if not exist c:\ra\n2down.txt goto n1wait
  216. goto dofidodiffs
  217. :n1wait
  218. echo.
  219. echo Waiting for Node N2 to go down...
  220. dvcomand wait 50
  221. goto 1diffn1
  222. :diffn2
  223. rem>c:\fd\n1\fdexit.255
  224. :2diffn2
  225. if not exist c:\ra\n1down.txt goto n2wait
  226. goto dofidodiffs
  227. :n2wait
  228. echo.
  229. echo Waiting for Node N1 to go down...
  230. dvcomand wait 50
  231. goto 2diffn2
  232. :diffn3
  233. rem>c:\fd\n1\fdexit.255
  234. rem>c:\fd\n2\fdexit.255
  235. :3diffn3
  236. if not exist c:\ra\n1down.txt goto n3wait
  237. if not exist c:\ra\n2down.txt goto n3wait
  238. goto dofidodiffs
  239. :n3wait
  240. echo.
  241. echo Waiting on Node(s) to go down for Diff processing...
  242. dvcomand wait 50
  243. goto 3diffn3
  244. :dofidodiffs
  245. copy c:\fd\files\nodediff.* c:\files\diffs
  246. daynbr /-14 /d5 del c:\fd\nodelist\save\nodelist.@###
  247. daynbr /-7 /d5 copy c:\fd\nodelist\nodelist.@### c:\fd\nodelist\save
  248. sysnl merge nodelist nodediff c
  249. daynbr /-7 /d5 del c:\fd\nodelist\nodelist.@###
  250. daynbr /-7 /d5 del c:\files\diffs\nodelist.@Z##
  251. daynbr /-35 /d5 del c:\files\diffs\nodediff.@A##
  252. daynbr /d5 pkzip c:\files\diffs\nodelist.@Z## nodelist.@###
  253. goto compile
  254. :compile
  255. c:
  256. cd\fd\n1
  257. fdnc /f
  258. cd\ra\%node%
  259. ranode
  260. goto nodelist
  261. :unpackmail
  262. echo.
  263. echo Checking to see if FD Node(s) are down...
  264. if exist c:\ra\n?down.txt goto openfdnodes
  265. goto nodesup
  266. :openfdnodes
  267. echo .
  268. echo Bringing FD Node(s) back online...
  269. if exist c:\fd\n1\fdexit.255 del c:\fd\n1\fdexit.255
  270. if exist c:\fd\n2\fdexit.255 del c:\fd\n2\fdexit.255
  271. if exist c:\ra\n1down.txt dvcomand open c:\dv\n1
  272. if exist c:\ra\n2down.txt dvcomand open c:\dv\n2
  273. :nodesup
  274. echo.
  275. echo Tossing INBOUND mail...
  276. echo.>>c:\logs\inbound.log
  277. echo Node %node% tossed this mail bundle.>>c:\logs\inbound.log
  278. c:
  279. cd\ra\%node%
  280. imail toss
  281. mbutil import
  282. mbutil link -clean
  283. rem>c:\fd\n1\fdrescan.now
  284. rem>c:\fd\n1\fmrescan.now
  285. rem>c:\fd\n2\fdrescan.now
  286. rem>c:\fd\n2\fmrescan.now
  287. if exist c:\ra\mail!.txt    del c:\ra\mail!.txt
  288. if exist c:\ra\N?toss.txt   del c:\ra\N?toss.txt
  289. if exist c:\ra\%node%inchck.txt goto back2update
  290. if exist c:\ra\%node%outchk.txt goto backfromtoss
  291. if %node% == N3 goto N3exit
  292. goto start
  293. :ralocal
  294. if %node% == N1 goto tosschk1l
  295. if %node% == N2 goto tosschk2l
  296. if %node% == N3 goto tosschk3l
  297. :tosschk1l                   
  298. if exist c:\ra\N2toss.txt goto fdbusyl
  299. if exist c:\ra\N3toss.txt goto fdbusyl
  300. :tosschk2l
  301. if exist c:\ra\N1toss.txt goto fdbusyl
  302. if exist c:\ra\N3toss.txt goto fdbusyl
  303. :tosschk3l
  304. if exist c:\ra\N1toss.txt goto fdbusyl
  305. if exist c:\ra\N2toss.txt goto fdbusyl
  306. echo.
  307. echo Notifying other nodes that this node is online...
  308. rem>c:\ra\%node%isup.txt
  309. set oldport=%port%
  310. set port=0
  311. c:
  312. cd\ra\%node%
  313. ra -%node% -l -e20
  314. set port=%oldport%
  315. set oldport=
  316. goto afterra
  317. :fdbusyl
  318. type c:\ra\fdbusy.txt
  319. dvcomand wait 50
  320. goto start
  321. :fdbusy
  322. echo.
  323. echo Notifying user of System Maintainence in progress.
  324. echo.
  325. type c:\ra\fdbusy.txt > com%port%:
  326. dtr com%port%: off
  327. dtr com%port%: on
  328. at com%port%: h1
  329. goto start
  330. :outbound
  331. if %node% == N1 goto downnode
  332. if %node% == N2 goto downnode
  333. if %node% == N3 goto nodeupout
  334. :downnode
  335. dtr com%port%: off
  336. dtr com%port%: on
  337. at com%port%: h1
  338. if %node% == N2 goto nodeupout
  339. if %node% == N1 goto nodeupout
  340. :nodeupout
  341. echo.
  342. echo Checking for waiting INBOUND mail...
  343. if not exist c:\ra\mail!.txt goto jump
  344. echo.
  345. echo We have waiting INBOUND mail. Going to toss it now...
  346. rem>c:\ra\%node%outchk.txt
  347. goto inbound
  348. :jump
  349. :backfromtoss
  350. echo.
  351. echo Checking for another node online...
  352. if exist c:\ra\%node%outchk.txt del c:\ra\%node%outchk.txt
  353. if %node% == N1 goto 1echoloop
  354. if %node% == N2 goto 2echoloop
  355. if %node% == N3 goto 3echoloop
  356. :1echoloop
  357. if not exist c:\ra\N2isup.txt goto chk3
  358. echo.
  359. echo Node N2 is online. Waiting till later to scan OUTBOUND mail...
  360. goto start
  361. :2echoloop
  362. if not exist c:\ra\N1isup.txt goto chk3
  363. echo.
  364. echo Node N1 is online. Waiting till later to scan OUTBOUND mail...
  365. goto start
  366. :3echoloop
  367. if not exist c:\ra\N1isup.txt goto chk2
  368. echo.
  369. echo Node N1 is online. Waiting till later to scan OUTBOUND mail...
  370. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  371. goto end
  372. :chk2
  373. if not exist c:\ra\N2isup.txt goto echook
  374. echo.
  375. echo Node N2 is online. Waiting till later to scan OUTBOUND mail...
  376. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  377. goto end
  378. :chk3
  379. if not exist c:\ra\N3isup.txt goto echook
  380. echo.
  381. echo Node N3 is online. Waiting till later to scan OUTBOUND mail...
  382. goto start
  383. :echook
  384. echo.
  385. echo Scanning for OUTBOUND mail...
  386. c:
  387. cd\ra\%node%
  388. if exist c:\ra\msgbase\echomail.bbs del c:\ra\msgbase\echomail.bbs
  389. if exist c:\ra\msgbase\netmail.bbs del c:\ra\msgbase\netmail.bbs
  390. mbutil export
  391. imail scan
  392. rem>c:\fd\n1\fdrescan.now
  393. rem>c:\fd\n1\fmrescan.now
  394. rem>c:\fd\n2\fdrescan.now
  395. rem>c:\fd\n2\fmrescan.now
  396. :update
  397. echo.
  398. echo Attempting to update user bulletins...
  399. if %node% == N3 goto lookup
  400. dtr com%port%: off
  401. dtr com%port%: on
  402. at com%port%: h1
  403. :lookup
  404. if not exist c:\ra\mail!.txt goto jump1
  405. rem>%node%inchck.txt
  406. goto inbound
  407. :jump1
  408. :back2update
  409. if exist c:\ra\msgs\echomail.bbs goto outbound
  410. if exist c:\ra\msgs\netmail.bbs goto outbound
  411. if %node% == N1 goto check1
  412. if %node% == N2 goto check2
  413. if not exist c:\ra\N1isup.txt goto chck2
  414. echo.
  415. echo Node N1 is online. Waiting till later to update bulletins...
  416. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  417. goto end
  418. :check2
  419. if not exist c:\ra\N1isup.txt goto chck3
  420. echo.
  421. echo Node N1 is online. Waiting till later to update bulletins...
  422. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  423. goto start
  424. :check1
  425. if not exist c:\ra\N2isup.txt goto chck3
  426. echo.
  427. echo Node N2 is online. Waiting till later to update bulletins...
  428. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  429. goto start
  430. :chck2
  431. if not exist c:\ra\N2isup.txt goto doupdate
  432. echo.
  433. echo Node N2 is online. Waiting till later to update bulletins...
  434. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  435. goto end
  436. :chck3
  437. if not exist c:\ra\N3isup.txt goto doupdate
  438. echo.
  439. echo Node N3 is online. Waiting till later to update bulletins...
  440. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  441. goto start
  442. :doupdate
  443. usa
  444. :n3exit
  445. del c:\ra\%node%isup.txt
  446. if %node% == N3 goto end
  447. goto start
  448. :nightly
  449. dtr com%port%: off
  450. dtr com%port%: on
  451. at com%port%: h1
  452. if exist c:\ra\N1isup.txt del c:\ra\N1isup.txt
  453. if exist c:\ra\N2isup.txt goto wait
  454. if exist c:\ra\N2toss.txt goto wait
  455. if exist c:\ra\N3isup.txt goto wait
  456. if exist c:\ra\N3toss.txt goto wait
  457. echo.
  458. echo Running Nightly Maintenance...
  459. rem>c:\ra\N1toss.txt
  460. call c:\ra\runmaint.bat
  461. goto start
  462. :wait
  463. echo.
  464. echo Waiting on another node so I can run nightly maintenance...
  465. dvcomand wait 100
  466. goto nightly
  467. :weekly
  468. if %node% == N1 dtr com%port%: on
  469. if %node% == N1 at com%port%: h1
  470. if %node% == N2 goto start
  471. if exist c:\ra\N1isup.txt del c:\ra\N1isup.txt
  472. if exist c:\ra\N2isup.txt goto wwait
  473. if exist c:\ra\N2toss.txt goto wwait
  474. if exist c:\ra\N3isup.txt goto wwait
  475. if exist c:\ra\N3toss.txt goto wwait
  476. echo.
  477. echo Running Weekly Maintenance...
  478. rem>c:\ra\N1toss.txt
  479. imthings stat
  480. goto start
  481. :wwait
  482. echo.
  483. echo Waiting on another node so I can run weekly maintenance...
  484. dvcomand wait 100
  485. goto weekly
  486. :enderror
  487. cls
  488. echo Node %node% is down with a FATAL error!
  489. echo Attempting to reload and correct in 5 seconds..
  490. dvcomand wait 50
  491. bnu /c
  492. goto start
  493. :endok
  494. cls
  495. dtr com%port%: off
  496. dtr com%port%: on
  497. at com%port%: h1
  498. :endok2
  499. echo Node %node% has been exited normally. The phone is unuseable.
  500. :end
  501. if exist c:\ra\%node%isup.txt del c:\ra\%node%isup.txt
  502. if exist c:\ra\%node%load.txt del c:\ra\%node%load.txt
  503. rem>c:\ra\%node%down.txt
  504. :endok3
  505. dvactive
  506. if errorlevel 1 exit
  507. bnu /u
  508.